﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;

namespace DAO
{
    public class ChucVuRepository
    {
        public List<ChucVuDTO> LayDanhSachChucVu()
        {
            List<ChucVuDTO> list = new List<ChucVuDTO>();
            try
            {
                QLTVEntities contex = new QLTVEntities();
                var query = from chucvu in contex.CHUC_VUList
                            select chucvu;
                foreach (var chucvuEF in query)
                {
                    ChucVuDTO chucvuDTO = new ChucVuDTO();
                    chucvuDTO.MaChucVu = chucvuEF.MaChucVu;
                    chucvuDTO.TenChucVu = chucvuEF.TenChucVu;
                    list.Add(chucvuDTO);
                }
            }
            catch (System.Exception)
            {
            }
            return list;
        }
    }
}
